<template>
  <view class="uni-view-compatible">
    <view class="uni-view-main">
      <view class="uni-view-head">
       <!-- <view class="uni-view-logo">
          <image class="uni-view-logo-icon" :src="'/static/images/gathering/alipay.png'" :mode="'scaleToFill'"></image>
        </view> -->

        <view class="uni-view-tips">
          {{ payStatus }}
        </view>

        <view class="uni-view-money">
          {{ payMoney ? '¥ ' + payMoney : '¥ 0.00' }}
        </view>

        <view class="uni-view-pay">
          <view class="uni-view-pay-left">
            <!-- <view class="uni-view-pay-tips">
              {{ '门店名称: ' }}
            </view> -->
            <view class="uni-view-pay-tips">
              {{ '支付方式: ' }}
            </view>
          </view>
          <view class="uni-view-pay-right">
           <!-- <view class="uni-view-pay-value">
              {{ shopName ? shopName + '门店' : '未知门店' }}
            </view> -->
            <view class="uni-view-pay-value">
              {{ payWay ? payWay : '未知方式' }}
            </view>
          </view>
        </view>
      </view>

      <view class="uni-view-body">
        <view class="uni-view-operate">
          <view class="uni-view-back-btn" @tap="navBackPay">
            {{ '返回收款码支付' }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
let _this;
export default {
  data() {
    return {
      shopName: null,
      payMoney: null,
      payWay: null,
      payStatus: '查询中...'
    };
  },
  onLoad(e) {
    _this = this;

    if(!e){
      _this.$api.msg('支付参数丢失');
      return;
    }
    /* if(!e.shopName){
      _this.$api.msg('门店名称参数丢失');
      return;
    } */
    if(!e.payMoney){
      _this.$api.msg('支付金额参数丢失');
      return;
    }
    if(!e.payWay){
      _this.$api.msg('支付方式参数丢失');
      return;
    }

    _this.shopName = e.shopName;
    _this.payMoney = e.payMoney;
    _this.payWay = e.payWay;
    _this.payStatus = '支付成功';

    if(_this.payWay.indexOf('支付宝') > -1){
      _this.payWay = '支付宝支付';
    }
  },
  onShow() {

  },
  onPullDownRefresh() {
    uni.stopPullDownRefresh();
  },
  methods: {
    navBackPay(){
      uni.navigateTo({
        url: '/pages/quickpay/quickpay'
      });
    }
  }
};
</script>

<style lang="scss">
@import '~@/pages/gathering/result/result.scss';
</style>
